google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn({type:'string', role:'annotation'}); data.addColumn({type:'string', role:'annotationText'}); data.addColumn('number', 'iOS総合'); data.addColumn({type:'string', role:'annotation'}); data.addColumn({type:'string', role:'annotationText'}); data.addRows([ ['00:00',null,null,null,21,'【21位】','21位'], ['01:05',null,null,null,21,null,null], ['01:15',null,null,null,22,'【22位】','22位'], ['02:20',null,null,null,22,null,null], ['03:25',null,null,null,22,null,null], ['04:30',null,null,null,22,null,null], ['05:35',null,null,null,22,null,null], ['06:40',null,null,null,22,null,null], ['07:00',null,null,null,23,'【23位】','23位'], ['08:05',null,null,null,23,null,null], ['09:10',null,null,null,23,null,null], ['10:15',null,null,null,23,null,null], ['11:20',null,null,null,23,null,null], ['12:25',null,null,null,23,null,null], ['13:00',null,null,null,25,'【25位】','25位'], ['14:05',null,null,null,25,null,null], ['15:10',null,null,null,25,null,null], ['16:05',null,null,null,28,'【28位】','28位'], ['17:10',null,null,null,28,null,null], ['18:15',null,null,null,28,null,null], ['19:05',null,null,null,29,'【29位】','29位'], ['20:10',null,null,null,29,null,null], ['21:15',null,null,null,29,null,null], ['22:15',null,null,null,35,'【35位】','35位'], ['23:20',null,null,null,35,null,null], ['00:00',null,null,null,35,null,null] ]); var options = { chartArea: {'width':'90%', 'height':'65%', 'left':40 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { format:'#',viewWindow:{min:11,max:40},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['pink','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=0 -1 ; var lastlogcat=6; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });